# -*-coding:utf-8-*-
import psutil 
import webbrowser  as webb
import os
import time
def get_pid():
	pid_list = list(psutil.process_iter())
	ie_pid = []
	for pid in pid_list:
		if 'iexplore.exe'in str(pid)[15:-1]:
			ie_pid.append(str(pid)[19:23])    #相关进程的所有pid

# url = 'http://u4814895.viewer.maka.im/k/NGVY7GOP'
i = 0
while i <= 100:
	iePath = r'C:\Program Files (x86)\Internet Explorer\iexplore.exe'           
	webb.register('iexplore', None, webb.BackgroundBrowser(iePath))  
	webb.get('iexplore').open_new_tab('http://u4814895.viewer.maka.im/k/NGVY7GOP')  
# web = webb.open('url')
	time.sleep(15)
	os.popen('taskkill -f -t -im iexplore.exe')   # 杀死所有相关进程
	i = i + 1

# import requests

# header = {'Accept': 'application/json, text/javascript, */*; q=0.01',
#           'Accept-Encoding': 'gzip, deflate, sdch',
#           'Accept-Language': 'zh-CN,zh;q=0.8,en-US;q=0.6,en;q=0.4',
#           'Cache-Control': 'no-cache',
#           'Connection': 'keep-alive',
#           'Origin': 'http://u4814895.viewer.maka.im',
#           'Pragma': 'no-cache',
#           'Referer': 'http://u4814895.viewer.maka.im/k/NGVY7GOP',
#           'User-Agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 9_1 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Version/9.0 Mobile/13B143 Safari/601.1'
#           }
# with requests.Session() as s:
#     first = s.get('http://u4814895.viewer.maka.im/k/NGVY7GOP', headers=header)
#     wechat = s.get('http://wxsign.maka.im/wechatsign', headers=header)
# # print(import requests

# header = {'Accept':'application/json, text/javascript, */*; q=0.01',
#           'Accept-Encoding':'gzip, deflate, sdch',
#           'Accept-Language':'zh-CN,zh;q=0.8,en-US;q=0.6,en;q=0.4',
#           'Cache-Control':'no-cache',
#           'Connection':'keep-alive',
#           'Origin':'http://u4814895.viewer.maka.im',
#           'Pragma':'no-cache',
#           'Referer':'http://u4814895.viewer.maka.im/k/NGVY7GOP',
#           'User-Agent':'Mozilla/5.0 (iPhone; CPU iPhone OS 9_1 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Version/9.0 Mobile/13B143 Safari/601.1'
#          }
# with requests.Session() as s:
#     first = s.get('http://u4814895.viewer.maka.im/k/NGVY7GOP', headers=header)
#     # a = s.get(url_json, headers=header)
#     wechat = s.get('http://wxsign.maka.im/wechatsign', headers=header)
